export default {
  Encode: function(html) {
    // 富文本用的html编码
    let temp = document.createElement('div');
    (temp.textContent != null) ? (temp.textContent = html) : (temp.innerText = html);
    let output = temp.innerHTML;
    temp = null;
    return output;
  },

  Decode: function (text) {
    // 富文本用的html解码
    let temp = document.createElement('div');
    temp.innerHTML = text;
    let output = temp.innerText || temp.textContent;
    temp = null;
    return output;
  }
};
